feat: add Greenfield API endpoints for Tron USDt addresses - #33
Open
learntheropes wants to merge 18 commits into
Open
feat: add Greenfield API endpoints for Tron USDt addresses#33learntheropes wants to merge 18 commits into
learntheropes wants to merge 18 commits into
Conversation
Adds USDT on Polygon PoS as a second EVM chain alongside Ethereum,
reusing the existing EVM infrastructure (EthUSDtRPCProvider,
EthUSDtListener, EthUSDtLikeSummaryUpdaterHostedService) which
iterates EVMUSDtLikeConfigurationItems and handles all chains
automatically. No new hosted services are needed.
Changes:
- Add Constants.PolygonChainName and AmoyChainName
- Add BlockTimeSeconds to EthUSDtLikeConfigurationItem (ETH=12s, Polygon=2s)
for correct sync threshold calculation
- Add ChainId to EthUSDtLikeConfigurationItem (ETH=1, Polygon=137)
for correct EIP-681 QR code generation
- Rename EthereumUSDtLikeConfigurationItems to EVMUSDtLikeConfigurationItems
- Add GetPolygonUSDtHardcodedConfig with mainnet (chainId=137,
contract=0xc2132d..., polygon-rpc.com, polygonscan.com) and Amoy testnet
- Add GetEVMUSDtDefaultConfigurationItem dispatcher by payment method ID
- Update UIEthUSDtLikeServerController to handle any EVM chain via
{paymentMethodId} route param
- Add chain-specific store view GetStorePolygonUSDtLikePaymentMethod
- Wire Polygon in RegisterServices with its own payment handler,
payment link extension, checkout model, and transaction link provider
- Add hidden DisplayName input in server config view to fix POST validation
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- TargetFramework: net8.0 → net10.0 - LangVersion: 12 → 13 - Npgsql.EntityFrameworkCore.PostgreSQL: 8.0.11 → 10.0.0 - global.json SDK: 8.0.404 → 10.0.100 - Minimum BTCPayServer version: >=2.0.0 → >=2.3.7 (first .NET 10 release) - Replace HttpContext.GetStoreData() with GetStoreDataOrNull() per breaking change - Update btcpayserver submodule to latest master Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds GET /api/v1/stores/{storeId}/evmUSDtlike/{paymentMethodId} to
retrieve store configuration with address balances and availability,
POST .../addresses to add an EVM address, and DELETE .../addresses/{address}
to remove one. Includes Swagger documentation for all three endpoints.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
There was a problem hiding this comment.
Pull request overview
This PR expands the USDt plugin’s Greenfield API and EVM-chain support by adding address-management endpoints and updating configuration/UI wiring to handle multiple EVM USDt-like chains (including Polygon/Amoy), alongside a .NET SDK/TFM and dependency upgrade.
Changes:
- Add Greenfield endpoints (and Swagger docs) for managing EVM and Tron USDt-like addresses.
- Refactor “Ethereum” USDt-like configuration into a multi-chain EVM configuration, and add Polygon/Amoy defaults + UI/navigation.
- Upgrade to .NET 10 and update Nethereum/Npgsql dependencies.
Reviewed changes
Copilot reviewed 27 out of 27 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| global.json | Bump repo SDK to .NET 10 |
| BTCPayServer.Plugins.USDt/BTCPayServer.Plugins.USDt.csproj | Move plugin to net10.0 + dependency upgrades |
| BTCPayServer.Plugins.USDt.Tests/BTCPayServer.Plugins.USDt.Tests.csproj | Move tests to net10.0 |
| BTCPayServer.Plugins.USDt/USDtPlugin.cs | Add Polygon config + refactor ETH→EVM wiring + payment link chainId |
| BTCPayServer.Plugins.USDt/Configuration/USDtPluginConfiguration.cs | Rename Ethereum config dict to EVM dict |
| BTCPayServer.Plugins.USDt/Configuration/Ethereum/EthUSDtLikeConfigurationItem.cs | Add BlockTimeSeconds + ChainId to config |
| BTCPayServer.Plugins.USDt/Configuration/Constants.cs | Add chain name constants (Sepolia/Polygon/Amoy) |
| BTCPayServer.Plugins.USDt/Services/Payments/EthUSDtPaymentLinkExtension.cs | Add EIP-681 chainId in payment links |
| BTCPayServer.Plugins.USDt/Services/EthUSDtRPCProvider.cs | Use EVM config dict + block-time-based sync threshold |
| BTCPayServer.Plugins.USDt/Services/EthUSDtListener.cs | Iterate EVM config dict for listeners |
| BTCPayServer.Plugins.USDt/Services/EthUSDtLikeSummaryUpdaterHostedService.cs | Iterate EVM config dict for summary updates |
| BTCPayServer.Plugins.USDt/Controllers/UIEthUSDtLikeStoreController.cs | Multi-chain EVM store UI support + Polygon view selection |
| BTCPayServer.Plugins.USDt/Controllers/UIEthUSDtLikeServerController.cs | Multi-chain server config route and lookup by paymentMethodId |
| BTCPayServer.Plugins.USDt/Controllers/UITronUSDtLikeStoreController.cs | Use GetStoreDataOrNull + minor parsing tweak |
| BTCPayServer.Plugins.USDt/Controllers/UITronUSDtLikeServerController.cs | Minor parsing tweak |
| BTCPayServer.Plugins.USDt/Controllers/GreenfieldEthUSDtLikeStoreController.cs | New EVM Greenfield store endpoints |
| BTCPayServer.Plugins.USDt/Controllers/GreenfieldTronUSDtLikeStoreController.cs | Add Tron Greenfield address add/delete endpoints |
| BTCPayServer.Plugins.USDt/Controllers/SwaggerProvider.cs | Extend Swagger JSON for EVM + Tron address endpoints |
| BTCPayServer.Plugins.USDt/Controllers/Models/EthUSDtPaymentMethodInformation.cs | New EVM response + add-address request models |
| BTCPayServer.Plugins.USDt/Controllers/Models/TronUSDtPaymentMethodInformation.cs | Add Tron add-address request model |
| BTCPayServer.Plugins.USDt/Controllers/ViewModels/EthUSDtLikeServerConfigViewModel.cs | Make DisplayName settable for POST binding |
| BTCPayServer.Plugins.USDt/Views/UIEthUSDtLikeServer/GetServerConfig.cshtml | Active-page key per EVM paymentMethodId + hidden DisplayName |
| BTCPayServer.Plugins.USDt/Views/UIEthUSDtLikeStore/GetStorePolygonUSDtLikePaymentMethod.cshtml | New Polygon store payment-method settings page |
| BTCPayServer.Plugins.USDt/Views/Shared/EthUSDtLike/StoreWalletsNavEthUSDtExtension.cshtml | Update nav to EVM config dict + GetStoreDataOrNull |
| BTCPayServer.Plugins.USDt/Views/Shared/TronUSDtLike/StoreWalletsNavTronUSDtExtension.cshtml | Use GetStoreDataOrNull |
| BTCPayServer.Plugins.USDt/Views/Shared/EthUSDtLike/ServerNavEthUSDtExtension.cshtml | Render server nav entries for each EVM chain |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
The add-address endpoint now accepts a list of addresses in a single request. Invalid and duplicate addresses are reported together in the error response. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
learntheropes
force-pushed
the
feature/tron-greenfield
branch
from
April 6, 2026 06:19
d082064 to
db45a7c
Compare
Inject StoreRepository and call UpdateStore after adding or removing addresses so changes survive the request. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds POST /api/v1/stores/{storeId}/tronUSDtlike/{paymentMethodId}/addresses
to add a Tron address and DELETE .../addresses/{address} to remove one.
Includes Swagger documentation for both endpoints.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Both EVM and Tron add-address endpoints now accept a list of addresses in a single request instead of one at a time. Invalid and duplicate addresses are reported together in the error response. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…points Inject StoreRepository and call UpdateStore after adding or removing addresses so changes survive the request. Also fixes AddAddress to accept an array of addresses matching the EVM endpoint behaviour. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
learntheropes
force-pushed
the
feature/tron-greenfield
branch
from
April 6, 2026 06:33
3f8c313 to
5b7e10a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
POST /api/v1/stores/{storeId}/tronUSDtlike/{paymentMethodId}/addresses— adds a Tron address (validates Tron format, rejects duplicates)DELETE /api/v1/stores/{storeId}/tronUSDtlike/{paymentMethodId}/addresses/{address}— removes a Tron addressNote: depends on
feature/evm-greenfield(#31).Test plan
🤖 Generated with Claude Code